# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=openscenegraph
pkgver=3.6.5
pkgrel=14
pkgdesc="High performance 3D graphics toolkit"
url="http://www.openscenegraph.org/"
arch="all"
license="LGPL-2.1-or-later"  # also Custom and wxWindows-3
depends_dev="mesa-dev"
makedepends="
	$depends_dev
	cmake
	curl-dev
	freetype-dev
	gdal-dev
	giflib-dev
	jpeg-dev
	libxml2-dev
	samurai
	sdl2-dev
	tiff-dev
	zlib-dev
	"
subpackages="$pkgname-dev $pkgname-doc"
source="https://github.com/openscenegraph/OpenSceneGraph/archive/OpenSceneGraph-$pkgver.tar.gz
	musl-fixes.patch
	add-missing-include-for-ppc64le.patch
	"
builddir="$srcdir"/OpenSceneGraph-OpenSceneGraph-$pkgver

build() {
	cmake -B build -G Ninja -Wno-dev \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS -Wno-deprecated-copy"
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	install -D -m644 LICENSE.txt "$pkgdir/usr/share/doc/$pkgname/LICENSE"
}

sha512sums="
7002fa30a3bcf6551d2e1050b4ca75a3736013fd190e4f50953717406864da1952deb09f530bc8c5ddf6e4b90204baec7dbc283f497829846d46d561f66feb4b  OpenSceneGraph-3.6.5.tar.gz
a3182ae355de0ed00cdda56a48dc2b13b4dedb3faee35d1718c0e2d661f3de097155116bfdc681c55039663188af1ab21a8366e25532d934b85fbffc20d842c9  musl-fixes.patch
a3e69609b2e3c51002f4babd1c5bd64fc9c32b14fc9232f4b4f345c6e96134bc80a0fe54ce3445059b4d0512d5ac1ec434101fe976b71f24c68b3569265e21d9  add-missing-include-for-ppc64le.patch
"
